<?php

namespace frontend\controllers;

use Yii;
use frontend\components\Controller;

/**
 * 帮助信息接口
 * HelpController
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class HelpController extends Controller {

    /**
     * Declares the allowed HTTP verbs.
     * Please refer to [[VerbFilter::actions]] on how to declare the allowed verbs.
     * @return array the allowed HTTP verbs.
     */
    protected function verbs() {
        return [
            '*' => ['GET'],
        ];
    }

    public $modelClass = 'frontend\models\HelpSearch';

    /**
     * {@inheritdoc}
     */
    public function actions() {
        return [
            'view' => [
                'class' => 'yii\rest\ViewAction',
                'modelClass' => $this->modelClass,
            ],
        ];
    }

    /**
     * 根据分类ID检索课程列表
     * @inheritdoc
     */
    public function actionIndex() {
        /* @var $modelClass \frontend\models\HelpSearch */
        $modelClass = new $this->modelClass;
        return $modelClass->search();
    }

}
